package cn.tedu.appointment.work.service.impl;

import cn.tedu.appointment.accounts.mapper.StaffMapper;
import cn.tedu.appointment.accounts.pojo.dto.StaffSearchParam;
import cn.tedu.appointment.accounts.pojo.entity.Staff;
import cn.tedu.appointment.accounts.pojo.vo.StaffVO;
import cn.tedu.appointment.work.mapper.SchedulesMapper;
import cn.tedu.appointment.work.pojo.dto.SchedulesQuery;
import cn.tedu.appointment.work.pojo.vo.SchedulesVO;
import cn.tedu.appointment.work.service.SchedulesService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.stereotype.Service;

import java.util.Collections;
import java.util.List;

@Slf4j
@Service
public class SchedulesServiceImpl implements SchedulesService {

    @Autowired
    SchedulesMapper schedulesMapper;
    @Autowired
    StaffMapper staffMapper;

    @Override
    public List<StaffVO> selectNoSchedules() {
        StaffSearchParam staffSearchParam = new StaffSearchParam();
        staffSearchParam.setJob("2");
        List<StaffVO> staffVOList = staffMapper.select(staffSearchParam);
        return staffVOList;
    }

    @Override
    public List<SchedulesVO> selectSchedules(SchedulesQuery schedulesQuery) {
        log.debug("查询已排班信息业务:schedulesQuery={}",schedulesQuery);
        List<SchedulesVO> schedulesVOList = schedulesMapper.select(schedulesQuery);
        return schedulesVOList;
    }


}
